import { reqGetSearchList } from "@/api/search"
const state = {
    searchList : {}
}
const mutations = {
    GETSEARCHLIST(state,searchList){
        state.searchList = searchList
    }
}
const actions = {
    // 获取搜索商品数据
    async getSearchList({commit},params={}){
        let data = await reqGetSearchList(params)
        if(data.code === 200){
            commit('GETSEARCHLIST',data.data)
        }
    }
}
const getters = {
    // 商品手机图片介绍
    goodsList(state){
        return state.searchList.goodsList || []
    },
    // 商品手机配置信息
    attrsList(state){
        return state.searchList.attrsList || []
    },
    // 商品手机品牌
    trademarkList(state){
        return state.searchList.trademarkList || []
    }
}

export default {
    state,
    mutations,
    actions,
    getters
}